package com.zoo.diannaopeijian.mapper;

import com.zoo.diannaopeijian.domain.Staff;
import com.zoo.diannaopeijian.domain.StaffExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface StaffMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table staff
     *
     * @mbggenerated
     */
    @SelectProvider(type=StaffSqlProvider.class, method="countByExample")
    int countByExample(StaffExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table staff
     *
     * @mbggenerated
     */
    @DeleteProvider(type=StaffSqlProvider.class, method="deleteByExample")
    int deleteByExample(StaffExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table staff
     *
     * @mbggenerated
     */
    @Delete({
        "delete from staff",
        "where StaffId = #{staffid,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer staffid);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table staff
     *
     * @mbggenerated
     */
    @Insert({
        "insert into staff (StaffId, StaffName, ",
        "StaffPassword, StaffPasswordSalt)",
        "values (#{staffid,jdbcType=INTEGER}, #{staffname,jdbcType=VARCHAR}, ",
        "#{staffpassword,jdbcType=VARCHAR}, #{staffpasswordsalt,jdbcType=VARCHAR})"
    })
    int insert(Staff record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table staff
     *
     * @mbggenerated
     */
    @InsertProvider(type=StaffSqlProvider.class, method="insertSelective")
    int insertSelective(Staff record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table staff
     *
     * @mbggenerated
     */
    @SelectProvider(type=StaffSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="StaffId", property="staffid", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="StaffName", property="staffname", jdbcType=JdbcType.VARCHAR),
        @Result(column="StaffPassword", property="staffpassword", jdbcType=JdbcType.VARCHAR),
        @Result(column="StaffPasswordSalt", property="staffpasswordsalt", jdbcType=JdbcType.VARCHAR)
    })
    List<Staff> selectByExample(StaffExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table staff
     *
     * @mbggenerated
     */
    @Select({
        "select",
        "StaffId, StaffName, StaffPassword, StaffPasswordSalt",
        "from staff",
        "where StaffId = #{staffid,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="StaffId", property="staffid", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="StaffName", property="staffname", jdbcType=JdbcType.VARCHAR),
        @Result(column="StaffPassword", property="staffpassword", jdbcType=JdbcType.VARCHAR),
        @Result(column="StaffPasswordSalt", property="staffpasswordsalt", jdbcType=JdbcType.VARCHAR)
    })
    Staff selectByPrimaryKey(Integer staffid);

    @Select({
            "select StaffPasswordSalt from staff where StaffId = #{staffid,jdbcType=INTEGER}"
    })
    String selectSaltByPrimaryKey(Integer staffid);

    @SelectProvider(type=StaffSqlProvider.class, method="selectFuzzyStaff")
    @Results({
            @Result(column="StaffId", property="staffid", jdbcType=JdbcType.INTEGER, id=true),
            @Result(column="StaffName", property="staffname", jdbcType=JdbcType.VARCHAR),
    })
    List<Staff> selectFuzzyStaff(Staff staff);


    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table staff
     *
     * @mbggenerated
     */
    @UpdateProvider(type=StaffSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") Staff record, @Param("example") StaffExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table staff
     *
     * @mbggenerated
     */
    @UpdateProvider(type=StaffSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") Staff record, @Param("example") StaffExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table staff
     *
     * @mbggenerated
     */
    @UpdateProvider(type=StaffSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(Staff record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table staff
     *
     * @mbggenerated
     */
    @Update({
        "update staff",
        "set StaffName = #{staffname,jdbcType=VARCHAR},",
          "StaffPassword = #{staffpassword,jdbcType=VARCHAR},",
          "StaffPasswordSalt = #{staffpasswordsalt,jdbcType=VARCHAR}",
        "where StaffId = #{staffid,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(Staff record);
}